#include <QApplication>
#include <QQmlContext>
#include <QQmlEngine>
#include <QQuickView>

#include "qtquick2applicationviewer.h"

#include "voicecommands.h"
#include "barcodescanner.h"
#include "facecapture.h"
#include "settings.h"

#include <QCoreApplication>

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    BarcodeScanner barcodeScanner;
    VoiceCommands voiceCommands;
    FaceCapture faceCapture;
    Settings settings;

    QtQuick2ApplicationViewer viewer;
    viewer.setMainQmlFile(QStringLiteral("qml/MyKit/MyKit.qml"));

    QQmlEngine *engine = viewer.engine();

    engine->rootContext()->setContextProperty("voiceCommands", &voiceCommands);
    engine->rootContext()->setContextProperty("barcodeScanner", &barcodeScanner);
    engine->rootContext()->setContextProperty("faceCapture", &faceCapture);
    engine->rootContext()->setContextProperty("settings", &settings);

    //viewer.setFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
    viewer.showExpanded();
    
    return app.exec();
}
